package com.sk.restree.controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sk.restree.model.action.ActionFactory;

//compfee
public class CompareFeeController extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		execute(request, response);
	}

	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
//		request.setCharacterEncoding("EUC-KR");
		response.setContentType("text/json; charset=EUC-KR");
		response.setHeader("Cache-Control", "no-cache");
		execute(request, response);
	}

	private void execute(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		String root = request.getContextPath();

		String act = request.getParameter("act");
		System.out.println("act===" + act);

		String path = "/index.jsp";
		boolean flag = true;

		if ("getbanklist".equals(act)) {
			ActionFactory.getBankNFeeAction().execute(request,response);
		}else if("use".equals(act)){
			ActionFactory.getSpendFeeAction().execute(request,response);
		}

	}

}
